package com.jl.jlapp.popu;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.jl.jlapp.R;

public class ClearHistorySearhPopu extends PopupWindow {
    TextView cancelBtn;
    CardView cardView;
    TextView okBtn;
    TextView popuContent;
    private TextView tvKnow;
    private View view;

    public ClearHistorySearhPopu(Context paramContext, OnClickListener paramOnClickListener, Integer paramInteger) {
        super(paramContext);
        this.view = ((LayoutInflater) paramContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.clear_history_search_popu, null);
        this.cardView = ((CardView) this.view.findViewById(R.id.layout));
        this.cancelBtn = ((TextView) this.view.findViewById(R.id.clear_history_bottom_cancel_btn));
        this.cancelBtn.setVisibility(View.VISIBLE);
        this.okBtn = ((TextView) this.view.findViewById(R.id.clear_history_bottom_ok_btn));
        this.popuContent = ((TextView) this.view.findViewById(R.id.popu_content));

        this.okBtn.setOnClickListener(paramOnClickListener);
        setContentView(this.view);
        setWidth(-1);
        setHeight(-1);
        setFocusable(true);
        setAnimationStyle(R.style.AnimBottom);
        setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(paramContext, R.color.white)));
        this.cancelBtn.setOnClickListener(new OnClickListener() {
            public void onClick(View paramAnonymousView) {
                ClearHistorySearhPopu.this.dismiss();
            }
        });
        this.view.setOnTouchListener(new OnTouchListener() {
            public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent) {
                int i = ClearHistorySearhPopu.this.cardView.getTop();
                int j = ClearHistorySearhPopu.this.cardView.getLeft();
                int k = ClearHistorySearhPopu.this.cardView.getWidth();
                int m = ClearHistorySearhPopu.this.cardView.getHeight();
                int n = (int) paramAnonymousMotionEvent.getY();
                int i1 = (int) paramAnonymousMotionEvent.getX();
                if ((paramAnonymousMotionEvent.getAction() == 1) && ((n < i) || (i1 < j) || (n > i + m) || (i1 > j + k))) {
                    ClearHistorySearhPopu.this.dismiss();
                }
                return true;
            }
        });
        if (paramInteger.intValue() == 0) {
            this.popuContent.setText(R.string.sure_to_empty_search_history);
        } else if (paramInteger.intValue() == 1) {
            this.popuContent.setText(R.string.sure_to_delete);
        } else if (paramInteger.intValue() == 2) {
            this.popuContent.setText(R.string.sure_to_cancel_order);
        } else if (paramInteger.intValue() == 3) {
            this.cancelBtn.setVisibility(View.GONE);
            this.popuContent.setText(R.string.apply_success);
        } else if (paramInteger.intValue() == 4) {
            this.popuContent.setText(R.string.sure_to_delete_order);
        } else if (paramInteger.intValue() == 5) {
            this.popuContent.setText("确定收货吗？");
        } else if (paramInteger.intValue() == 6) {
            this.popuContent.setText("确定清空缓存吗？");
        } else if (paramInteger.intValue() == 7) {
            this.popuContent.setText("确定退出登录吗？");
        } else if (paramInteger.intValue() == 8) {
            this.popuContent.setText("确定删除该公司吗？");
        } else if (paramInteger.intValue() == 9) {
            this.popuContent.setText("您的编辑尚未保存，是否确认离开此页面？");
        } else if (paramInteger.intValue() == 10) {
            this.popuContent.setText("确定删除该增票资质吗？");
        } else if (paramInteger.intValue() == 11) {
            this.popuContent.setText("确定要清空全部消息吗？");
        } else if (paramInteger.intValue() == 12) {
            this.popuContent.setText("您的订单尚未支付,是否确认离开此页面？");
        }
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/popu/ClearHistorySearhPopu.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */